pp108 : Adding Dynamic Filters

Adding Dynamic Filters

This topic describes the procedure to add dynamic filters to the implementation and interface of the Web service operation(method).
  1. In the implementation of the GetEmployeeDF method, change the WHERE field and add the following dynamic filters:
    WHERE :DF1 and :DF2 and :DF3
    Note: In this case you must provide 3 conditions at runtime. It is also possible to add one dynamic filter in the implementation and at runtime.
  2. Change the parameter value by replacing the EmployeeID parameter with the following
    • <DF1 type='dfilter'/>
    • <DF2 type='dfilter'/>
    • <DF3 type='dfilter'/>
      Implementation is as follows:
      <implementation type="DBSQL">
          <constructor language="DBSQL">
              <query>SELECT "EmployeeID","LastName","FirstName","City" FROM "Employees"
      WHERE :DF1 and :DF2 and :DF3</query>
              <parameters>
                  <DF1 type="dfilter"/>
                  <DF2 type="dfilter"/>
                  <DF3 type="dfilter"/>
              </parameters>
          </constructor>
      </implementation>
      
  3. In the interface of the method, change the GetEmployee DF element and the interface is as follows
    <xsd:element name="GetEmployeeDF">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="DF1">
                    <xsd:complexType mixed="true">
                        <xsd:attribute default="dfilter" name="type"/>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="DF2">
                    <xsd:complexType mixed="true">
                        <xsd:attribute default="dfilter" name="type"/>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="DF3">
                    <xsd:complexType mixed="true">
                        <xsd:attribute default="dfilter" name="type"/>
                    </xsd:complexType>
                </xsd:element>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>